// 国际化功能

import Cookies from "js-cookie";

import langJson from "./langJson.json"; // 消息下发-模拟数据


export let langName = {}; // 国际化集合

// 获取国际化信息
export function getLangFun(){
  if(Cookies.get("lang")==undefined){
    Cookies.set("lang",1)
  }
  let langCookies = Cookies.get("lang")
  console.log("获取语言===="+langCookies)
  let langData = langJson.data;
  // let field = [];
  for (let i = 0; i < langData.length; i++) {
    if (!langCookies || langCookies == "0") {
      langName[langData[i].fieldname] = langData[i].chinese;
      // field.push(langName[langData[i].fieldname])
    } else if(langCookies==1){
      langName[langData[i].fieldname] = langData[i].translationlanguage;
      // field.push(langName[langData[i].fieldname])
    }else{
      langName[langData[i].fieldname] = langData[i].Amharic;
    }
  }
  // console.log("获取语言====json",field)
}
getLangFun()